﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;

namespace WcfServiceLibrary1 {
    [ServiceContract(CallbackContract=typeof(CallbackI),SessionMode= SessionMode.Allowed)]
      
    public interface IMyService
    {

        [OperationContract]
        [FaultContract(typeof(Error))]
        string metodo();
        [OperationContract(Name = "OneWay",IsOneWay= true)]
        void oneWayMethod();

        [OperationContract]
        Usuario datacontractResponse();
        
        [OperationContract]
        Stream Data();

    }
 
    [DataContract]
    public class Usuario {
        [DataMember]
        string nombre = "jose";
        [DataMember]
        string id = "18261459";

        public Usuario() { 
        
        }
    }


    [DataContract]
    public class Error { 
        [DataMember]
       public string erroGeneral = "ERRROORRRRRRRRRRRRR!!!!";
   
    } 



    public interface CallbackI {
        [OperationContract(IsOneWay=true)]
        void listo(string msj);
    
    }


    
}
